<include file="Index/header" />


<div class="container">
	<form action="?m=home&c=user&a=register" method="post" onsubmit="return checkForm()"
		style="width: 30%; margin: 60px auto;">
		<div class="form-group">
			<label for="u_name">用户名</label>
			<input type="text" class="form-control" placeholder="用户名" name="u_name" id="uname">
		</div>
		<div class="form-group">
			<label for="u_pwd1">密码</label>
			<input type="password" class="form-control" placeholder="密码" name="u_pwd1" id="upwd1">
		</div>
		<div class="form-group">
			<label for="u_pwd2">密码</label>
			<input type="password" class="form-control" placeholder="确认密码" name="u_pwd2" id="upwd2">
		</div>
		<div class="form-group">
			<label for="u_phone">手机号</label>
			<input type="text" class="form-control" placeholder="手机号" name="u_phone" id="uphone">
		</div>
		<div class="form-group">
			<label for="u_email">邮箱</label>
			<input type="text" class="form-control" placeholder="邮箱" name="u_email" id="uemail">
		</div>
		<div class="logo">
			<label>
				<a href="?m=home&c=user&a=login" class="text-muted glyphicon glyphicon-arrow-right">已注册，去登陆吧！</a>
			</label>
		</div>
		<button type="submit" class="btn btn-primary btn-lg btn-block">注 册</button>
	</form>
	<!--错误信息提示-->
	<notempty name='error'>
		<div class='alert alert-danger' style="margin-right:60%">
			<span style='color:red'>错误信息:</span>
			<foreach name='error' item='error'>
				<li>{$error}</li>
			</foreach>
		</div>
	</notempty>
</div>

<script type="text/javascript">
	//进行初步非空检测
	function checkForm() {
		var u = document.getElementById("uname").value;
		var p1 = document.getElementById("upwd1").value;
		var p2 = document.getElementById("upwd2").value;
		var uphone = document.getElementById("uphone").value;
		var uemail = document.getElementById("uemail").value;
		if (u == "") {
			alert("用户名不能为空！！");
			return false;
		}
		else if (p1 == "") {
			alert("密码不能为空！！");
			return false;
		}
		else if (uphone == "") {
			alert("手机号未填写！！");
			return false;
		}
		else if (uemail == "") {
			alert("邮箱未填写！！");
			return false;
		}
		else if (p1 != p2) {
			alert("前后密码不一致！");
			return false;
		}
		return true;
	}
</script>
<include file="Index/footer" />